//
// Created by zain on 2017/3/1.
//

#include "SkyMaterial.h"
using namespace ZainGL;
using namespace glm;

ZainGL::SkyMaterial::SkyMaterial(const GLchar *pathV, const GLchar *pathF,
                                 std::unordered_map<std::string, ZainTL::FileDatas> *bufferMap) : Material(pathV, pathF,
                                                                                                           bufferMap) {

}

void SkyMaterial::update(glm::mat4 viewMat, glm::vec3 viewPos, glm::mat4 projMat, std::vector<Light *> lights, GLfloat d, GLfloat d1) {
    active();
    glUniformMatrix4fv(glGetUniformLocation(mShaderLoc, "projection"), 1, GL_FALSE, value_ptr(projMat));
    GLint viewLoc = glGetUniformLocation(mShaderLoc, "view");
    glUniformMatrix4fv(viewLoc, 1, GL_FALSE, value_ptr(mat4(mat3(viewMat))));// Remove any translation component of the view matrix
}
